Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mission dialogue rmlui widget #4233

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

RebelNode
Copy link
Collaborator

@RebelNode RebelNode commented Jan 26, 2025

This adds a way to call dialogue popups for missions. It's intended to be used with mission api and still needs to be integrated into that once mission api is ready for it.

Works with
WG['mission_dialogue'].SendDialogue(character_name, message, character_portrait, side, soundfile, popupTimeout)
e.g.
WG['mission_dialogue'].SendDialogue("Some Dude","Hello World!", "somedude.png", "right", "dialogue1.wav",5)

image

Copy link
Member

@WatchTheFort WatchTheFort left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a lot of questions about architecture we still need to answer, particularly around file and folder structure. We should settle those questions before we start merging rmlui widgets.

luaui/Widgets/gui_mission_dialogue.lua Outdated Show resolved Hide resolved
luaui/Widgets/gui_mission_dialogue.lua Outdated Show resolved Hide resolved
luaui/Widgets/gui_mission_dialogue.lua Outdated Show resolved Hide resolved
luaui/Widgets/gui_mission_dialogue.lua Outdated Show resolved Hide resolved
luaui/Widgets/gui_mission_dialogue.lua Outdated Show resolved Hide resolved
luaui/Widgets/gui_mission_dialogue.lua Show resolved Hide resolved
luaui/Widgets/gui_mission_dialogue.lua Show resolved Hide resolved
luaui/Widgets/gui_mission_dialogue.lua Outdated Show resolved Hide resolved
@RebelNode
Copy link
Collaborator Author

I changed the folder structure a little bit. Old one was just what Chris used in his example widgets.

I propose that all .rml files will be in /luaui/Widgets/rml and all .rcss files will be in /luaui/Widgets/rcss. Furthermore I propose that we will have two main rcss files: bar_ui.rcss that contains the common styles that we use in new UI and default_styles.rcss that contains fallback default styles for the basic elements when nothing else is defined for them.

@WatchTheFort
Copy link
Member

WatchTheFort commented Jan 27, 2025

I think it would make more sense for each widget to be a folder, containing the .lua and .rml files, along with any widget-specific .rcss or resource files (images, sounds, etc.). Since the .lua and .rml files are tightly coupled, they are always worked on at the same time, so it makes sense for them to be located together.

There would be shared folders for common elements, like global .rcss files, images, and sounds.


--hide dialogue popup after a while
popupTimer = popupTimer + dt
if popupTimer > popupTimeout then
Copy link
Contributor

@badosu badosu Jan 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After the first time the document is hidden won't it be spamming calls to document:Hide() again? Even then, would be good to not even have the update callin when the dialogue is unused.

I'd suggest registering the :Update callin once the dialog is shown, and deregistering when it's hidden. Deregistering on initialization.

See

widgetHandler:UpdateCallIn('GameFrame');
else
widgetHandler:RemoveCallIn('GameFrame');
as an example of dynamic callin registration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants